package com.shy.springframework.test.event;

import com.shy.springframework.context.ApplicationListener;

import java.util.Date;

/**
 * @author yzpang
 * @desc: 事件监听器实现
 * @date: 2023/2/9 16:35
 */
public class CustomEventListener implements ApplicationListener<CustomEvent> {
    @Override
    public void onApplicationEvent(CustomEvent event) {
        System.out.println("收到:" + event.getSource() + "消息, 时间: " + new Date());
        System.out.println("消息:" + event.getId() + ":" + event.getMessage());
    }
}
